/*
 *   Time Tracking Web Application
 *   Copyright (C) 2008, Nick Griffiths
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *   
 *   Contact nicobrevin at gmail dot com
 *   http://code.google.com/p/openharvest/
 */

package org.brevs.time.dao;

import java.util.Date;
import java.util.List;

import org.appfuse.model.User;
import org.brevs.time.model.Entry;
import org.brevs.time.model.Project;

public interface TimeDao {

	/**
	 * Save an {@link Entry} to the db
	 * @param entry
	 */
	void saveEntry(Entry entry);

	/**
	 * 
	 * @param user
	 * @param date
	 * @return
	 */
	List<Entry> getEntries(User user, Date date);

	/**
	 * Gets a list of all projects.
	 * TODO move to {@link ProjectDao}
	 * @return
	 */
	List<Project> getProjects();

	/**
	 * Updates a project.
	 * TODO move to the {@link ProjectDao}
	 * @param project
	 */
	void saveProject(Project project);

	/**
	 * Returns an Entry by its Primary Key.
	 * @param id
	 * @return
	 */
	Entry getEntry(Long id);

	/**
	 * Returns a list of Entry objects for a {@link User}
	 * @param user the user who owns the entries
	 * @param running look for running (true) or not running timers (false)
	 * {@link Entry} objects
	 * @return
	 */
	List<Entry> getEntries(User user, boolean running);
	
}
